<?php include_partial('basketPage/progress', array('node' => $node)) ?>


<div class="one_half">
    <h3><?php echo __('biller') ?></h5>
    <?php $biller = $basket->getBillingAddress(); ?>
    <?php if(!$biller['is_company']): ?>
        <h4 style="margin-bottom:5px;"><?php echo $biller['first_name'].' '.$biller['last_name']; ?></h6>
        <h5 style="margin-bottom:10px;"><?php echo $biller['identity_code']; ?></h5>
    <?php else: ?>
        <h4 style="margin-bottom:5px;"><?php echo $biller['company_name']; ?></h6>
        <h5 style="margin-bottom:10px;"><?php echo $biller['reg_code']; ?></h5>
    <?php endif; ?>        
        <ul class="arrow_list">
            <li><?php echo $biller['email']; ?></li>
            <li><?php echo $biller['phone']; ?></li>
            <li><?php echo $biller['address']; ?></li>
            <li><?php echo $biller['city']; ?></li>
            <li><?php echo $biller['state']; ?></li>
            <li><?php echo $biller['zip']; ?></li>
        </ul> 
</div>
<?php if($biller['addresses_different']): ?>
<div class="one_half last">
    <h3><?php echo __('shipper') ?></h5>
    <?php $shipper = $basket->getShippingAddress(); ?>
    <?php if(!$shipper['is_company']): ?>
        <h4 style="margin-bottom:5px;"><?php echo $shipper['first_name'].' '.$shipper['last_name']; ?></h6>
        <h5 style="margin-bottom:10px;"><?php echo $shipper['identity_code']; ?></h5>
    <?php else: ?>
        <h4 style="margin-bottom:5px;"><?php echo $shipper['company_name']; ?></h6>
        <h5 style="margin-bottom:10px;"><?php echo $shipper['reg_code']; ?></h5>
    <?php endif; ?>        
        <ul class="arrow_list">
            <li><?php echo $shipper['email']; ?></li>
            <li><?php echo $shipper['phone']; ?></li>
            <li><?php echo $shipper['address']; ?></li>
            <li><?php echo $shipper['city']; ?></li>
            <li><?php echo $shipper['state']; ?></li>
            <li><?php echo $shipper['zip']; ?></li>
        </ul> 
    
</div>
<?php endif; ?>
<div class="clearboth"></div>


<div id="popular-widget" class="widget webtreats_popular_widget">
    <h3 class="widgettitle"><?php echo __('Cart'); ?></h3>	
    <ul class="thumbnail_list">
	<?php include_partial('basketPage/userBasketListTable', array('products'=>$products, 'ro' => true)) ?>	    
	<?php include_partial('basketPage/userBasketListTotalPayable', array('totalPayable' => $totalPayable)) ?>
    </ul>
</div><!-- popular-widget -->



	
<?php include_partial('basketPage/paymentMethods') ?>

<?php include_partial('basketPage/termsAndConds', array('termsAndConditionsNode' => $termsAndConditionsNode)) ?>

<!--maksmise valik ends -->


<p><a class="button_link proceed" href="<?php echo LinkGen::getInstance(LinkGen::STRUCTURE_ACTIONS)->link(null, array('module' => 'basketPage', 'action' => 'doCheckout')) ?>"><span><?php echo __('vormista ost') ?></span></a></p>

<script type="text/javascript">
jQuery('.proceed').click(function(e){
	e.preventDefault();

	var paymentTypeContainer = jQuery('#selected_payment');
	var termsAndConds = jQuery('#terms_and_conditions');
	var link = jQuery.queryString(jQuery(this).attr('href'), 'type=' + paymentTypeContainer.text() );

	if(paymentTypeContainer.text() == ''){
		alert('select payment method');
		return false;
	}

//	if(!termsAndConds.hasClass('active')){
//		alert('accept terms and conditions');
//		return false;
//	}
        

	window.location.href = link;
	return false;
});
</script>